<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1 style="text-align: center">
    关于JSON对象
</h1>
<hr>
<p id="demo"></p>
<script type="text/javascript">
    var text = '{ ' +
        '"sites" : [' +
            '{ "name":"Runoob" , "url":"www.runoob.com" },' +
            '{ "name":"Google" , "url":"www.google.com" },' +
            '{ "name":"Taobao" , "url":"www.taobao.com" } ' +
        ']}';

    obj = JSON.parse(text);
    document.getElementById("demo").innerHTML = obj.sites[1].name + obj.sites[1].url;
    /*for (var i=0, e=obj.length;i<e;i++) {

    }*/

</script>

</body>
</html>